<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:core="http://www.contact.core.com/contacts/core/ui"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:common="http://www.contact.common.com/contacts/ui"
        >

<!--@elvariable id="id" type="java.lang.String"-->
<ui:component>
    <style type="text/css">
        table.noborder td {
            border: 0;
        }
    </style>
    <rich:dataTable id="#{id}jobTable"
                    style="background:inherit; border:none;" cellpadding="0"
                    value="#{eduWorkInformationSessionBean.allJobs}"
                    styleClass="noborder"
                    var="data">


        <rich:column>

            <h:panelGrid columns="2">
                <h:outputLabel value="Employer:"/>
                <h:inputText value="#{data.employer}"/>

                <h:outputLabel value="Position:"/>
                <h:inputText value="#{data.position}"/>

                <h:outputLabel value="Description:"/>
                <h:inputTextarea rows="2" value="#{data.description}"/>

                <h:outputLabel value="City/Town: "/>
                <h:inputText value="#{data.city}"/>

                <h:outputLabel value="Time Period:"/>

                <h:selectBooleanCheckbox value="#{data.currentlyWork}"


                        >
                    <h:outputLabel value="Currlently work here."/>
                    <a4j:support event="onchange" reRender="#{id}jobTable"/>
                </h:selectBooleanCheckbox>


                <h:outputLabel value="Time Period:"/>
                <h:panelGrid columns="4">
                    <rich:comboBox value="#{data.beginDate.selectedMounth}"
                                   enableManualInput="false"
                                   selectFirstOnUpdate="false"
                                   defaultLabel="#{resources.mounthLabel}:"
                                   width="80px">

                        <f:selectItems value="#{data.beginDate.langMounths}"/>

                    </rich:comboBox>
                    <rich:comboBox value="#{data.beginDate.selectedYear}"
                                   enableManualInput="false"
                                   selectFirstOnUpdate="false"
                                   defaultLabel="#{resources.yearLabel}:"
                                   width="70px"
                                   style="margin-left:3px;">
                        <f:selectItems value="#{data.beginDate.years}"/>
                    </rich:comboBox>

                    <h:outputLabel value="to "/>
                    <h:outputLabel rendered="#{data.currentlyWork}" value="Present"/>

                    <rich:comboBox rendered="#{not data.currentlyWork}"
                                   value="#{data.endDate.selectedMounth}"
                                   enableManualInput="false"
                                   selectFirstOnUpdate="false"
                                   defaultLabel="#{resources.mounthLabel}:"
                                   width="80px">

                        <f:selectItems value="#{data.endDate.langMounths}"/>

                    </rich:comboBox>
                    <rich:comboBox rendered="#{not data.currentlyWork}"
                                   value="#{data.endDate.selectedYear}"
                                   enableManualInput="false"
                                   selectFirstOnUpdate="false"
                                   defaultLabel="#{resources.yearLabel}:"
                                   width="70px"
                                   style="margin-left:3px;">
                        <f:selectItems value="#{data.endDate.years}"/>
                    </rich:comboBox>
                </h:panelGrid>

                <h:column/>
                <a4j:commandLink reRender="#{id}jobTable"
                                 action="#{eduWorkInformation.removeJobRow}"
                                 value="Remove Job">
                    <f:param name="commonIndex" value="#{data.index}"/>
                </a4j:commandLink>
            </h:panelGrid>
        </rich:column>


    </rich:dataTable>
    <rich:separator style="margin-top:5px;margin-bottom:5px" height="1px" width="400px"/>
    <a4j:commandLink
            value="Add AnotherJob"
            action="#{eduWorkInformation.addNewJobRow}"
            reRender="#{id}jobTable"/>
</ui:component>


</html>
